﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;


namespace INSTA.MusiqueStore.DAL
{
    public class ConnectionCustomer
    {
        // public static int count;

        public static void Connection()
        {
        }

        public static void Connection(string Email)
        {
        }

        public static Client Connection(String Email, String Password)
        {
            //HttpContext h;
            string email;
            string passwd;

            email = Convert.ToString(Email);
            passwd = Convert.ToString(Password);

            var c = new MusiqueStoreEntities();
            var a = (from Client in c.Clients
                     where Client.Email == email && Client.Password == passwd
                     select Client).First();

            /*if (a.Count == 0)
             {
               
              
                // h.Response.Write("<script type='text/javascript'>window.open('~/Account/Register.aspx','Creation de compte');</script>"); 
                //h.Response.Write("~/Account/Register");
             }
             else
             {
              
                // h.Response.Write("<script type='text/javascript'>window.open('~/Main.Master','Accueil');</script>"); 
                 //response.redirect("~/Main.Master");

             }


            // count = a.Count;
           
         }*/

            
            return a;

        }
    }
}
